﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace game
{
    class Program
    {
        static void Main(string[] args)
        {
            opr_game1 opg = new opr_game1();
            string connSql = "server=.;database=game1;Integrated Security=true";
            SqlConnection conn = new SqlConnection(connSql);
            conn.Open();
            bool judge = true;
            do
            {
                if (conn.State == ConnectionState.Open)
                {
                    Console.WriteLine("增加：1，查询：2,退出：3");
                    string judge_operation = Console.ReadLine();
                    switch (judge_operation)
                    {
                        case "1":
                            opg.game1_insert(ref conn);
                            break;
                        case "2":
                            opg.game1_select(ref conn);
                            break;
                        case "3":
                            judge = false;
                            Console.WriteLine("还有下次使用！");
                            break;
                        default:
                            Console.WriteLine("输入错误！！！");
                            break;
                    }
                }
            } while (judge);
            conn.Close();
        }
    }
}
